﻿using Repository.Core.Models.Dto;
using Repository.Core.Models.Queries;
using Repository.Core.Models.VO;
using MiniFox.Components;
using MiniFox.Infrastructure;

namespace Repository.Core.Services
{
    [AutoRegister]
    public interface IVersionService
    {
        /// <summary>
        /// 
        /// </summary>
        string RepoName { get; }
        /// <summary>
        /// 签出并编辑
        /// </summary>
        /// <param name="versionSetName"></param>
        void CheckOut(string versionSetName);
        /// <summary>
        /// 提交版本
        /// </summary>
        /// <param name="dto"></param>
        void Commit(CommitDto dto);
        /// <summary>
        /// 拉取版本
        /// </summary>
        /// <param name="versionSetName"></param>
        /// <param name="versionId"></param>
        /// <returns></returns>
        VersionItemVo Pull(string versionSetName, long? versionId);
        /// <summary>
        /// 获取指定版本
        /// </summary>
        /// <param name="versionSetName"></param>
        /// <param name="versionId"></param>
        /// <returns></returns>
        object GetItemContent(string versionSetName, long versionId);
        /// <summary>
        /// 所有仓
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<VersionSetVo>> Query(PagedQueryObject<CommonQuery> request);
        /// <summary>
        /// 指定项的版本列表
        /// </summary>
        /// <param name="versionSetName"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<VersionItemVo>> VersionItems(string versionSetName, PagedQueryObject<VersionQuery> request);
        void Sync();
    }
}
